// 定大小的截图

var page = require('webpage').create();
//viewportSize being the actual size of the headless browser
page.viewportSize = {width: 2560, height: 1440};
//the clipRect is the portion of the page you are taking a screenshot of
page.clipRect = {top: 0, left: 0, width: 2560, height: 1440};
//the rest of the code is the same as the previous example
page.open('http://example.com/', function () {
    page.render('github2.png');
    phantom.exit();
});